﻿using System.Threading.Tasks;
using Colorful.Furniture.PermissionManagement;
using FreeSql;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.DependencyInjection;

namespace Colorful.Furniture;

/// <summary>
///  权限仓储
/// </summary>
public class FurniturePermissionStore : IPermissionStore, ITransientDependency
{
    private readonly IBaseRepository<SysManager> _manageRepository;

    public FurniturePermissionStore(IBaseRepository<SysManager> manageRepository)
    {
        _manageRepository = manageRepository;
    }

    public Task<bool> IsGrantedAsync(string name, string providerName, string providerKey)
    {
        return Task.FromResult(true);
    }

    public Task<MultiplePermissionGrantResult> IsGrantedAsync(string[] names, string providerName, string providerKey)
    {
        return Task.FromResult(new MultiplePermissionGrantResult(names, PermissionGrantResult.Granted));
    }
}